package cn.xuexiyuan.springstudy.core.demo05.config;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

/**
 * 创建后置处理器来处理每一个 bean 实例
 */
@Component
public class AduitCheckBeanPostProcessor implements BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("[postProcessAfterInitialization] ->" + bean + " 实例化完成");
        return bean;
    }
}
